package com.rth.common.utils;

import cn.dev33.satoken.secure.SaSecureUtil;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class RsaUtil {
    HashMap<String, String> keyMap = SaSecureUtil.rsaGenerateKeyPair();

    public RsaUtil() throws Exception {
    }

    public String getRsaEncryptObject(String object) {

        String publicKey = keyMap.get("public");
        return SaSecureUtil.rsaEncryptByPublic(publicKey, object);

    }
}
